<template>
  <van-sticky>
    <van-nav-bar :title="title" left-text="返回" left-arrow @click-left="onClickLeft">
    </van-nav-bar>
  </van-sticky>
</template>
<script setup>
import { Icon as VanIcon, NavBar as VanNavBar, Sticky as VanSticky } from "vant";
import router from "@/route/index.js";
import { useRoute } from "vue-router";
import { computed } from "vue";
const props = defineProps({
    title: {
      type: String,
      requird: true,
    },
  }),
  route = useRoute();
const isLeftHome = computed(() => {
  if (!!route.query.login) {
    return true;
  }
  return false;
});
function onClickLeft() {
  if (isLeftHome.value) {
    router.push("/home");
  } else {
    router.back();
  }
}
function onClickHome() {
  router.push("/")
}
</script>
